
const {ccclass, property} = cc._decorator;

/**
 * 显示基类
 */
@ccclass
export default class BaseComponent extends cc.Component {

    onLoad () {
        this.onCreate();
    }

    // start () {
    // }

    // update (dt) {}

    onDestroy(){
    }

    onEnable(){
    }

    onDisable(){
    }

    protected onCreate(): void
    {   
        cc.warn("0 ==> BaseComponent");
        this.initAllEventListener();
    }

    protected onExit(): void
    {
        this.deleteAllEventListener();
        if(this.node.children.length > 0)
        {
            this.node.removeAllChildren();
        }
    }

     // 初始化当前所有事件监听
    protected initAllEventListener():void
    {
        // todo
    }
        
    // 移除当前所有事件监听
    protected deleteAllEventListener():void
    {
        // todo
    }
}
